package com.zbiti.sentinel.controller;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author wangjin
 * @title: Test
 * @projectName sentinel
 * @description: TODO
 * @date 2022/5/31 0031 14:52
 */
public class Test {
    public static void main(String[] args) {

        // 2、日历类的时间操作 String.format(“%02d”, 123)
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar.get(Calendar.YEAR));
        System.out.println(String.format("%02d", calendar.get(Calendar.MONTH) + 1));
        System.out.println(String.format("%02d", calendar.get(Calendar.DATE) ));


    }
}
